/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbpedvicom")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbpedvicom.findAll", query = "SELECT p FROM Pyfntbpedvicom p"),
    @NamedQuery(name = "Pyfntbpedvicom.findByPyfntbpedvicomid", query = "SELECT p FROM Pyfntbpedvicom p WHERE p.pyfntbpedvicomid = :pyfntbpedvicomid"),
    @NamedQuery(name = "Pyfntbpedvicom.findByReferencia", query = "SELECT p FROM Pyfntbpedvicom p WHERE p.referencia = :referencia"),
    @NamedQuery(name = "Pyfntbpedvicom.findByFechareferencia", query = "SELECT p FROM Pyfntbpedvicom p WHERE p.fechareferencia = :fechareferencia"),
    @NamedQuery(name = "Pyfntbpedvicom.findByDescripcion", query = "SELECT p FROM Pyfntbpedvicom p WHERE p.descripcion = :descripcion"),
    @NamedQuery(name = "Pyfntbpedvicom.findByObservaciones", query = "SELECT p FROM Pyfntbpedvicom p WHERE p.observaciones = :observaciones")})
public class Pyfntbpedvicom implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbpedvicomid")
    private Integer pyfntbpedvicomid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "referencia")
    private String referencia;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechareferencia")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechareferencia;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 300)
    @Column(name = "descripcion")
    private String descripcion;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "scittbfadeceid", referencedColumnName = "scittbfadeceid")
    @ManyToOne(optional = false)
    private Scittbfadece scittbfadeceid;
    @JoinColumn(name = "scittbescunid", referencedColumnName = "scittbescunid")
    @ManyToOne
    private Scittbescun scittbescunid;
    @JoinColumn(name = "pyfntbpedviaticid", referencedColumnName = "pyfntbpedviaticid")
    @ManyToOne(optional = false)
    private Pyfntbpedviatic pyfntbpedviaticid;

    public Pyfntbpedvicom() {
    }

    public Pyfntbpedvicom(Integer pyfntbpedvicomid) {
        this.pyfntbpedvicomid = pyfntbpedvicomid;
    }

    public Pyfntbpedvicom(Integer pyfntbpedvicomid, String referencia, Date fechareferencia, String descripcion) {
        this.pyfntbpedvicomid = pyfntbpedvicomid;
        this.referencia = referencia;
        this.fechareferencia = fechareferencia;
        this.descripcion = descripcion;
    }

    public Integer getPyfntbpedvicomid() {
        return pyfntbpedvicomid;
    }

    public void setPyfntbpedvicomid(Integer pyfntbpedvicomid) {
        this.pyfntbpedvicomid = pyfntbpedvicomid;
    }

    public String getReferencia() {
        return referencia;
    }

    public void setReferencia(String referencia) {
        this.referencia = referencia;
    }

    public Date getFechareferencia() {
        return fechareferencia;
    }

    public void setFechareferencia(Date fechareferencia) {
        this.fechareferencia = fechareferencia;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Scittbfadece getScittbfadeceid() {
        return scittbfadeceid;
    }

    public void setScittbfadeceid(Scittbfadece scittbfadeceid) {
        this.scittbfadeceid = scittbfadeceid;
    }

    public Scittbescun getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(Scittbescun scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Pyfntbpedviatic getPyfntbpedviaticid() {
        return pyfntbpedviaticid;
    }

    public void setPyfntbpedviaticid(Pyfntbpedviatic pyfntbpedviaticid) {
        this.pyfntbpedviaticid = pyfntbpedviaticid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbpedvicomid != null ? pyfntbpedvicomid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbpedvicom)) {
            return false;
        }
        Pyfntbpedvicom other = (Pyfntbpedvicom) object;
        if ((this.pyfntbpedvicomid == null && other.pyfntbpedvicomid != null) || (this.pyfntbpedvicomid != null && !this.pyfntbpedvicomid.equals(other.pyfntbpedvicomid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbpedvicom[ pyfntbpedvicomid=" + pyfntbpedvicomid + " ]";
    }
    
}
